package com.mask.im.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mask.im.business.mapper.ComplaintsCauseMapper;
import com.mask.im.business.common.model.RestResponse;
import com.mask.im.business.model.entity.ComplaintsCauseDO;
import com.mask.im.business.service.ComplaintsCauseService;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author jian
 */
@Service
public class ComplaintsCauseServiceImpl extends ServiceImpl<ComplaintsCauseMapper, ComplaintsCauseDO> implements ComplaintsCauseService {

	@Override
	public RestResponse<List<ComplaintsCauseDO>> getAllComplaintsCause() {
		List<ComplaintsCauseDO> complaintsCauses = this.baseMapper.selectList(new LambdaQueryWrapper<ComplaintsCauseDO>()
						.select(ComplaintsCauseDO::getId,ComplaintsCauseDO::getName));
		return RestResponse.ok(complaintsCauses);
	}
}

